package com.xc.freeapp.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.xc.freeapp.dao.GoodsMapper;
import com.xc.freeapp.dao.dataSource.DBContextHolder;
import com.xc.freeapp.entity.Goods;

@Service
public class GoodsService {
	Logger log = Logger.getLogger(this.getClass());
	@Autowired
	GoodsMapper goodsMapper;
	
	 public List<Goods> selectByHospitalid(Integer hospitalid,PageBounds pageBounds){
		 DBContextHolder.switchDataSourceRW();//切换数据源
		 return goodsMapper.selectByHospitalid(hospitalid,pageBounds);
	 }
	 
	 public   Goods selectByPrimaryKey(Integer id){
		 DBContextHolder.switchDataSourceRW();//切换数据源
		 return goodsMapper.selectByPrimaryKey(id);
	 }
}
